package service.ClientService._stub;

import VO.HotelVO;
import VO.OrderInfoVO;
import service.ClientService.OrderHotelService;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * 
 * @author insomnia
 *
 */

public class OrderHotelService_stub extends UnicastRemoteObject implements OrderHotelService{

	private static final long serialVersionUID = 4021299446208942914L;

	public OrderHotelService_stub() throws RemoteException {
		super();
	}

	public Iterator<HotelVO> getHotelList(String address, String area, String price, int star, String grade)throws RemoteException {
		ArrayList <HotelVO>list=new ArrayList<HotelVO>();
		HotelVO hotel=new HotelVO("如家酒店", "南京最实惠的酒店", "南京市新街口", "新街口", "早餐供应", '3', "rujiaadmin", 5.0, 100, new String []{"南京大学"});
		list.add(hotel);
		Iterator <HotelVO>iter=list.iterator(); 
		return iter;
	    }

    public HotelVO getHotelInfo(String hotelName) throws RemoteException {
	        return new HotelVO("如家酒店","南京最好的酒店","南京新街口","新街口","早餐供应",'3',"rujiaadmin",5.0,100,null);

	 }
    
	
	/**
	 * 提交订单
	 * @param orderInfoVO
	 * @return 是否成功添加酒店
	 */
	public boolean submit(OrderInfoVO orderInfoVO)throws RemoteException{
		return true;
	}
	/**
	 * 检查信用度
	 * @param username
	 * @return 信用值是否小0
	 */
	public boolean checkCredit(String username)throws RemoteException{
		if(username.equals("000")){
			return true;
		}else{
			return false;
		}
	}

}
